---
title: "phone_meta_analysis"
author: "Jose S. Gomez"
date: "4/9/2019"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

#setup clean working environment, packages and data
```{r}
rm(list=ls())       # clear objects in memory
setwd("/Users/jge/Dropbox/GOTV IV (Andrew, Jose, Don)/Working Data/") # set working directory on Mac
#setwd("C:/Users/joses/Dropbox/GOTV IV (Andrew, Jose, Don)/Working Data/") # set working directory on Windows
library(foreign) 
library(metafor) # meta-analysis package

phone_data <- read.csv("GOTV IV phone data (overall collapsed).csv")
```

#Appendix C estimates in order of thier appearance within the book:
```{r}
#volunteer calls
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 2], 
                     sei= Meta_SE[phone_data$RoboVolunteerProfessional == 2], 
                     method = "DL", 
                     data = phone_data)

#commercial calls
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 3], 
                     sei= Meta_SE[phone_data$RoboVolunteerProfessional == 3], 
                     method = "DL", 
                     data = phone_data)

#robo calls
rma(yi = Meta_b[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 0], 
                               sei= Meta_SE[phone_data$RoboVolunteerProfessional == 1 & phone_data$SocialPressure == 0], 
                               method = "DL", 
                               data = phone_data)
```